package com.derbysoft.dswitch.adapter.ihg.common.domain;

import com.derbysoft.remote.dswitch.hotel.constants.PaymentType;

import javax.persistence.*;

@Entity
public class RatePlan {
    @Id
    @Column(nullable = false, length = 20)
    private String code;

    @Column(nullable = false, length = 50)
    private String name;

    @Column(length = 250)
    private String description;

    @OneToOne(optional = false, fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
    private FreeMeal freeMeal;

    @Column(nullable = false, columnDefinition = "boolean")
    private boolean needGuarantee;

    @Enumerated(EnumType.STRING)
    @Column(nullable = false, length = 10)
    private PaymentType paymentType;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public FreeMeal getFreeMeal() {
        return freeMeal;
    }

    public void setFreeMeal(FreeMeal freeMeal) {
        this.freeMeal = freeMeal;
    }

    public boolean getNeedGuarantee() {
        return needGuarantee;
    }

    public void setNeedGuarantee(boolean needGuarantee) {
        this.needGuarantee = needGuarantee;
    }

    public PaymentType getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(PaymentType paymentType) {
        this.paymentType = paymentType;
    }
}
